package DB.Boleto;

import DB.Inscricao.InscricaoTable;

public abstract class BoletoTable {

    private static final String INT_TYPE = " INT";
    private static final String TEXT_TYPE = " TEXT";
    private static final String REAL_TYPE = " REAL";
    private static final String COMMA_SEP = ", ";
    private static final String NOT_NULL = " NOT NULL ";
    
    public static final String TABLE_NAME = "boletos";
    
    public static final String COLUMN_ID = "id"; 
    public static final String COLUMN_IDINSCRICAO = "idInscricao";
    
    public static final String COLUMN_CEDENTE_NOME = "cedenteNome";
    public static final String COLUMN_CEDENTE_CPF = "cedenteCPF";
    
    public static final String COLUMN_SACADO_NOME = "sacadoNome";
    public static final String COLUMN_SACADO_CPF = "sacadoCPF";
    public static final String COLUMN_SACADO_UF = "sacadoUF";
    public static final String COLUMN_SACADO_LOCALIDADE = "sacadoLocalidade";
    public static final String COLUMN_SACADO_CEP = "sacadoCep";
    public static final String COLUMN_SACADO_LOGRADOURO = "sacadoLogradouro";
    
    public static final String COLUMN_BANCO_NOME = "nomeBanco";
    public static final String COLUMN_NUMERO_CONTA = "numeroConta";
    public static final String COLUMN_NUMERO_CONTA_DIGITO = "numeroContaDigito";
    public static final String COLUMN_CARTEIRA = "carteira";
    public static final String COLUMN_AGENCIA = "agencia";
    public static final String COLUMN_AGENCIA_DIGITO = "agenciaDigito";

    public static final String COLUMN_NUMERO_DOCUMENTO = "numeroDocumento";
    public static final String COLUMN_NOSSO_NUMERO = "nossoNumero";
    public static final String COLUMN_NOSSO_NUMERO_DIGITO = "nossoNumeroDigito";
    public static final String COLUMN_DATA_DOCUMENTO = "dataDocumento";
    public static final String COLUMN_DATA_VENCIMENTO = "dataVencimento";
    public static final String COLUMN_VALOR = "valor";

    public static final String COLUMN_LOCAL_PAGAMENTO = "localPagamento";
    public static final String COLUMN_INSTRUCAO_SACADO = "instrucaoSacado";
    
    public static final String COLUMN_INSTRUCAO1 = "instrucao1";
    public static final String COLUMN_INSTRUCAO2 = "instrucao2";
    public static final String COLUMN_INSTRUCAO3 = "instrucao3";
    public static final String COLUMN_INSTRUCAO4 = "instrucao4";
    
    public static final String TABLE_CREATE =
            "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "("
            + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT" + NOT_NULL + COMMA_SEP
            + COLUMN_IDINSCRICAO + INT_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_CEDENTE_NOME + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_CEDENTE_CPF + TEXT_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_SACADO_NOME + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_SACADO_CPF + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_SACADO_UF + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_SACADO_LOCALIDADE + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_SACADO_CEP + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_SACADO_LOGRADOURO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_BANCO_NOME + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_NUMERO_CONTA + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_NUMERO_CONTA_DIGITO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_CARTEIRA + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_AGENCIA + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_AGENCIA_DIGITO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_NUMERO_DOCUMENTO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_NOSSO_NUMERO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_NOSSO_NUMERO_DIGITO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_DATA_DOCUMENTO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_DATA_VENCIMENTO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_VALOR + REAL_TYPE + NOT_NULL + COMMA_SEP
            
            + COLUMN_LOCAL_PAGAMENTO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_INSTRUCAO_SACADO + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_INSTRUCAO1 + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_INSTRUCAO2 + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_INSTRUCAO3 + TEXT_TYPE + NOT_NULL + COMMA_SEP
            + COLUMN_INSTRUCAO4 + TEXT_TYPE + NOT_NULL + COMMA_SEP
            
            + "FOREIGN KEY(" + COLUMN_IDINSCRICAO + ") REFERENCES " + InscricaoTable.TABLE_NAME + "(" + InscricaoTable.COLUMN_ID + ") "
            + ");";
    
    public static final String DELETE_ALL = "DELETE FROM " + TABLE_NAME;
}
